<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://{$Think.server.HTTP_HOST}__TMPL__Public/" />
<title>无标题文档</title>
<link href="css/base.css" rel="stylesheet" type="text/css" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="css/auntion.css" rel="stylesheet" type="text/css" />
<script src="js/jquery.js" language="JavaScript" type="text/javascript"></script>
<script src="js/auntion.js" language="JavaScript" type="text/javascript"></script>
<script language="javascript">
var userpanel="index";
</script>
</head>
<body>
<div class="wrap">
	<include file="Public:header" />
  <div class="main">
    <div class="position"><a href="/">首页</a> &gt; <a href="javascript:;">用户中心</a></div>
    <div class="user">
    	<include file="userpanel" />
      <div class="userbox">
        	<!--<div class="user_tab">
            	<ul>
                	<li class="current"><a href="#">张大宝</a></li>
            		<li><a href="#">李四</a></li>
                </ul>
            </div>-->
            <div class="user_area">
            <div class="account">
            	<p class="loginname"><b>登录帐号：</b><a href="javascript:;" onclick="changepw();">修改密码</a><br/>{$user.username}</p>
                <p class="money"><b>账户余额：</b><br/><i>{:W("UserReal",array("field" => "balance"))}</i> 元<br/>
                	<button type="submit" class="btn btn-success">充值</button>
                    &nbsp;&nbsp;<button type="submit" class="btn btn-success">返还</button>
                </p>
            </div>
            <div class="address">
            	<h3>收货地址：<a href="javascript:addaddress();">增加地址</a></h3>
                <ul>
                	<li>收件人：阮世能<span><a href="#">设为默认</a> - <a href="#">编辑</a> - <a href="#">删除</a></span><br/>
                    手机号：13455555555&nbsp;&nbsp;&nbsp;&nbsp; 地址：杭州下沙经济开发区6号大街</li>
                    <li>收件人：阮世能<span><a href="#">设为默认</a> - <a href="#">编辑</a> - <a href="#">删除</a></span><br/>
                    手机号：13455555555&nbsp;&nbsp;&nbsp;&nbsp; 地址：杭州下沙经济开发区6号大街</li>
                </ul>
            </div>
            </div>
        </div>
      <div class="clear"></div>
    </div>
  </div>
  
  <include file="Public:footer" />
</div>
<script type="text/javascript"> 
function changepw(){
	var d_t = new at_trace();
		d_t.setContact(
			"增加地址",
			"<div class=add_address><p>旧密码:<input type='text' id='oldpassword' /></p><p>新密码:<input type='text' id='newpass' /></p><p>再输一次:<input type='text' id='newpass2' /></p><p id='msg'></p></div>",
			[
				d_t.getButton("确定", "yellow", function(){
					if($("#newpass").val()!=$("#newpass2").val())
					{
						$("#msg").html("两次密码不一致");
						return ;
					}
					
					$.getJSON("/Member/changepw",
					{
						oldpassword: $("#oldpassword").val(),
						newpassword: $("#newpass").val()
					},function(json){
						if(json.status==1)
						{
							//d_t.hide();
							d_t.setDisplay("hide");
							//setTimeout(function(){,500);
							at_infoTrace.show('密码已更新！','o');
						}
						else
						{
							$("#msg").html(json.info);
						}
					});
					
					
				}),
				d_t.getButton("返回", "gray", "close")
			]

		);
		d_t.setWidth(450);
		d_t.setDisplay("show");
}

function addaddress(){
	var d_t = new at_trace();
		d_t.setContact(
			"增加地址",
			"<div class=add_address><p>旧密码:<input type='text' id='oldpassword' /></p><p>新密码:<input type='text' id='newpass' /></p><p>再输一次:<input type='text' id='newpass2' /></p><p id='msg'></p></div>",
			[
				d_t.getButton("确定", "yellow", function(){
					if($("#newpass").val()!=$("#newpass2").val())
					{
						$("#msg").html("两次密码不一致");
						return ;
					}
					
					$.getJSON("/Member/changepw",
					{
						oldpassword: $("#oldpassword").val(),
						newpassword: $("#newpass").val()
					},function(json){
						if(json.status==1)
						{
							//d_t.hide();
							d_t.setDisplay("hide");
							//setTimeout(function(){,500);
							at_infoTrace.show('密码已更新！','o');
						}
						else
						{
							$("#msg").html(json.info);
						}
					});
					
					
				}),
				d_t.getButton("返回", "gray", "close")
			]

		);
		d_t.setWidth(450);
		d_t.setDisplay("show");
}
</script> 
</body>
</html>
